package com.wjerp.tplus.server.common.model;

import com.wjerp.tplus.server.common.utils.RSAUtils;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.ArrayList;
import java.util.List;

/**
 * The Class RegisterWrapper.
 */
@ToString
@Getter
@Setter
public class RegisterWrapper {

	private String token;
	//图片验证码
	private String text;
	
	/** The mobile. */
	private String mobile;
	
	/** The sms code. */
	private String smsCode;
	
	/** The password. */
	private String password;
	
	/** The recommender. */
	private String recommender;
	
	/** The accept terms. */
	private Boolean acceptTerms;

	private String inviteCode;

	private List<QuestionInfo> questionInfos=new ArrayList<>();

	public String getPassword() {
		if(password != null && !password.isEmpty()){
			try {
				password = new String(RSAUtils.decryptByPrivateKey(password));
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
		return password;
	}

}
